package com.bedepan;

import org.junit.jupiter.api.Test;
import org.junit.platform.commons.logging.Logger;
import org.junit.platform.commons.logging.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TestUser {

    //创建Logger对象
    Logger logger = LoggerFactory.getLogger(TestUser.class);
    @Test
    public void testUser(){
        //加载spring配置文件，对象创建
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");


        //获取创建的对象
        User user = (User) context.getBean("user");

        System.out.println(user);
        //使用对象调用方法测试
        user.add();

        //手动写日志
        logger.info(()->"##自定义日志成功！！");
    }
}
